import { ajax } from '@/utils'

import { BaseInfoDetail, selectDivision } from './riverTypes'

export default {
  //基本资料列表
  getImformationList(data): Promise<any> {
    return ajax.post(`/yswy-zy-activity/xhMemberManage/list`, data)
  },
  //启用账号
  active(id: number): Promise<any> {
    return ajax.get(`/yswy-zy-activity/xhMemberManage/active/${id}`)
  },
  //冻结账号
  froze(id: number): Promise<any> {
    return ajax.get(`/yswy-zy-activity/xhMemberManage/froze/${id}`)
  },
  //基本信息详情
  getDetail(id: any): Promise<BaseInfoDetail> {
    return ajax.get(`/yswy-zy-activity/xhMemberManage/detail/${id}`)
  },
  //上级姓名基本信息列表
  getParentName(data): Promise<any> {
    return ajax.post(`/yswy-zy-activity/xhMemberManage/listByParentName`, data)
  },
  //新建基本信息
  addImformation(data): Promise<any> {
    return ajax.post(`/yswy-zy-activity/xhMemberManage/create`, data)
  },
  //新建基本信息
  editImformation(data): Promise<any> {
    return ajax.post(`/yswy-zy-activity/xhMemberManage/edit`, data)
  },
  //查询所有事业部
  selectDivisionName(data): Promise<any> {
    return ajax.post(
      `/yswy-zy-activity/xhMemberManage/selectAllBusinessDivisionName`,
      data
    )
  },
  // 查询所有总部
  selectHeadDivisionName(data): Promise<any> {
    return ajax.post(
      `/yswy-zy-activity/xhMemberManage/selectAllHeadDivisionName`,
      data
    )
  },
  // 数据中心-预估&已提现
  getDataCenterTotalPrice(id): Promise<any> {
    return ajax.post(
      `/yswy-zy-activity/xhMemberManage/select/IndexWithdraw/${id}`
    )
  },
  // 数据中心-详情列表
  getWithdrawList(data): Promise<any> {
    return ajax.post(
      `/yswy-zy-activity/xhMemberManage/select/WithdrawList`,
      data
    )
  },
  // 数据中心页面-列表
  getDataCenterList(data): Promise<any> {
    return ajax.post(`/yswy-zy-activity/datacenter/select/list`, data)
  },
  // 数据中心页面-列表导出
  exportDataCenterList(): Promise<any> {
    return ajax.post(
      `/yswy-zy-activity/datacenter/export/list`,
      {},
      {
        responseType: 'blob',
        withResponse: true
      }
    )
  }
}
